import request from "@/utils/request";

export function Login(params: any) {
    return request({
        method: "post",
        url: "/backapi/login",
        data: formData(params),
    });
}

export function getAllUserInfo(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllUserInfo",
        params,
    });
}

export function getDirectList(params: any) {
    return request({
        method: "get",
        url: "/backapi/getDirectList",
        params
    });
}

export function getAllInvest(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllInvest",
        params
    });
}

export function getAllInvestReward(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllInvestReward",
        params
    });
}

export function getAllInvestRefReward(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllInvestRefReward",
        params
    });
}

export function getOrderList(params: any) {
    return request({
        method: "get",
        url: "/backapi/getOrderList",
        params
    });
}

export function getAddrs(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAddrs",
        params
    });
}


export function multiTransfer(params: any) {
    return request({
        method: "post",
        url: "/backapi/multiTransfer",
        data: formData(params),
    });
}



export function addDao(params: any) {
    return request({
        method: "post",
        url: "/backapi/addDao",
        data: formData(params),
    });
}

export function setParameterDao(params: any) {
    return request({
        method: "post",
        url: "/backapi/setParameterDao",
        data: formData(params),
    });
}

export function setParameterHFRate(params: any) {
    return request({
        method: "post",
        url: "/backapi/setParameterHFRate",
        data: formData(params),
    });
}



export function getAllStakeRefReward(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllStakeRefReward",
        params
    });
}

export function getAllStakePlan(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllStakePlan",
        params
    });
}


export function setStakePlan(params: any) {
    return request({
        method: "post",
        url: "/backapi/setStakePlan",
        data: formData(params),
    });
}


export function getAllStake(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllStake",
        params
    });
}



export function getAllDao(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllDao",
        params
    });
}

export function getAllDaoHF(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllDaoHF",
        params
    });
}





export function insertOrder(params: any) {
    return request({
        method: "post",
        url: "/backapi/insertOrder",
        data: formData(params),
    });
}

export function getOrderResult(params: any) {
    return request({
        method: "get",
        url: "/backapi/getOrderResult",
        params
    });
}

export function settleOrder(params: any) {
    return request({
        method: "post",
        url: "/backapi/settleOrder",
        data: formData(params),
    });
}

export function getAllOrderItem(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllOrderItem",
        params
    });
}

export function getAllRankPlayer(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllRankPlayer",
        params
    });
}

export function getAllRankRefReward(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllRankRefReward",
        params
    });
}

export function getAllNFT(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllNFT",
        params
    });
}

export function getAllSwap(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllSwap",
        params
    });
}

export function getAllTransfer(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAllTransfer",
        params
    });
}
export function getPriceList(params: any) {
    return request({
        method: "get",
        url: "/backapi/getPriceList",
        params
    });
}



export function getParameter() {
    return request({
        method: "get",
        url: "/backapi/getParameter",
    });
}

export function setParameterAddress(params: any) {
    return request({
        method: "post",
        url: "/backapi/setParameterAddress",
        data: formData(params),
    });
}

export function setUserStatus(params: any) {
    return request({
        method: "post",
        url: "/backapi/setUserStatus",
        data: formData(params),
    });
}

export function addBalance(params: any) {
    return request({
        method: "post",
        url: "/backapi/addBalance",
        data: formData(params),
    });
}

export function getAddBalanceList(params: any) {
    return request({
        method: "get",
        url: "/backapi/getAddBalanceList",
        params
    });
}

export function getLeaderList(params: any) {
    return request({
        method: "get",
        url: "/backapi/getLeaderList",
        params
    });
}

export function setParameterAmount(params: any) {
    return request({
        method: "post",
        url: "/backapi/setParameterAmount",
        data: formData(params),
    });
}

export function addUSDT(params: any) {
    return request({
        method: "post",
        url: "/backapi/addUSDT",
        data: formData(params),
    });
}


export function insertNews(params: any) {
    return request({
        method: 'post',
        url: "/backapi/insertNews",
        data: formData(params)
    })
}

export function updateNews(params: any) {
    return request({
        method: 'post',
        url: "/backapi/updateNews",
        data: formData(params)
    })
}

export function setNewsStatus(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setNewsStatus",
        data: formData(params)
    })
}

export function getAllNews(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllNews",
        params
    })
}
export function getAllReceive(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllReceive",
        params
    })
}

export function getAllReceiveTRX(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllReceiveTRX",
        params
    })
}

export function getAllSend(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllSend",
        params
    })
}

export function getWorkroomList(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getWorkroomList",
        params
    })
}

export function send(params: any) {
    return request({
        method: 'post',
        url: "/backapi/send",
        data: formData(params)
    })
}

export function setSendStatus(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setSendStatus",
        data: formData(params)
    })
}
export function setParameterPrice(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterPrice",
        data: formData(params)
    })
}
export function setUserWorkroom(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setUserWorkroom",
        data: formData(params)
    })
}

export function setParameterRank(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterRank",
        data: formData(params)
    })
}

export function setParameterInvest(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterInvest",
        data: formData(params)
    })
}

export function setUserLeader(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setUserLeader",
        data: formData(params)
    })
}


export function setUserRate(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setUserRate",
        data: formData(params)
    })
}



export function getAllCoupon(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllCoupon",
        params
    })
}
export function getAllNode(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllNode",
        params
    })
}

export function getAllNodeUSDT(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllNodeUSDT",
        params
    })
}

export function getAllNodeHF(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllNodeHF",
        params
    })
}


export function getAllApply(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllApply",
        params
    })
}


export function getAllWorkroomReward(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllWorkroomReward",
        params
    })
}


export function setCouponApply(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setCouponApply",
        data: formData(params)
    })
}

export function updateLeader(params: any) {
    return request({
        method: 'post',
        url: "/backapi/updateLeader",
        data: formData(params)
    })
}

export function setParameterNode(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterNode",
        data: formData(params)
    })
}

export function setParameterSend(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterSend",
        data: formData(params)
    })
}

export function setUserOpenSend(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setUserOpenSend",
        data: formData(params)
    })
}




export function setParameterTRX(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterTRX",
        data: formData(params)
    })
}

export function setParameterSendKey(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterSendKey",
        data: formData(params)
    })
}

export function setParameterAutoSend(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterAutoSend",
        data: formData(params)
    })
}

export function setParameterMaxOrderAmount(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterMaxOrderAmount",
        data: formData(params)
    })
}

export function setParameterCouponValue(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterCouponValue",
        data: formData(params)
    })
}

export function setParameterGameInterval(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterGameInterval",
        data: formData(params)
    })
}

export function setParameterGameTime(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterGameTime",
        data: formData(params)
    })
}

export function setParameterU(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setParameterU",
        data: formData(params)
    })
}


export function setUserAdmin(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setUserAdmin",
        data: formData(params)
    })
}

export function refundPlayer(params: any) {
    return request({
        method: 'post',
        url: "/backapi/refundPlayer",
        data: formData(params)
    })
}

export function upload(params: any) {
    return request({
        method: 'post',
        url: "/upapi/upload",
        data: params
    })
}





export function insertAnnouncement(params: any) {
    return request({
        method: 'post',
        url: "/backapi/insertAnnouncement",
        data: formData(params)
    })
}

export function updateAnnouncement(params: any) {
    return request({
        method: 'post',
        url: "/backapi/updateAnnouncement",
        data: formData(params)
    })
}

export function setAnnouncementStatus(params: any) {
    return request({
        method: 'post',
        url: "/backapi/setAnnouncementStatus",
        data: formData(params)
    })
}

export function getAllAnnouncement(params: any) {
    return request({
        method: 'get',
        url: "/backapi/getAllAnnouncement",
        params
    })
}


const formData = (params: any) => {
    let formData = new FormData();
    for (let i in params) {
        formData.append(i, params[i]);
    }
    return formData;
};
